From b841b265fe697e28e4d5ce47017910bf9b536de5 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 29 Feb 2024 11:13:58 +0700
Subject: Update get program line API only active is true

---
 src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx')

diff --git a/src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx b/src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx
index 8153f346..c4acacf1 100644
--- a/src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx
+++ b/src-migrate/pages/api/product-variant/[id]/promotion/highlight.tsx
@@ -16,7 +16,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
     let programs: any[] = []
 
     for (const type of types) {
-      queryParams.set('fq', `type_value_s:${type}`)
+      queryParams.set('fq', `type_value_s:${type}`) 
+      queryParams.append('fq', `active_b:true`)
+
       const response = await fetch(`${SOLR_HOST}/solr/promotion_program_lines/select?${queryParams.toString()}`)
       const data: SolrResponse<any[]> = await response.json()
       programs.push(...data.response.docs)
-- 
cgit v1.2.3

